package com.chat.datea.utils.data;

import java.util.Calendar;

/**
 * Created by xyb on 15/10/24.
 */
public class DataUtil {
    /**
     * 得到当前日期是星期几。
     *
     * @return 当为周日时，返回0，当为周一至周六时，则返回对应的1-6。
     */

    public static final int getCurrentDayOfWeek() {

        return Calendar.getInstance().get(Calendar.DAY_OF_WEEK) - 1;

    }

    public static final String getDataForString(){
        String s = null;
        if (getCurrentDayOfWeek() == 0){
            s = "日";
        }else if (getCurrentDayOfWeek() == 1){
            s = "一";
        }else if (getCurrentDayOfWeek() == 2){
            s = "二";
        }else if (getCurrentDayOfWeek() == 3){
            s = "三";
        }else if (getCurrentDayOfWeek() == 4){
            s = "四";
        }else if (getCurrentDayOfWeek() == 5){
            s = "五";
        }else if (getCurrentDayOfWeek() == 6){
            s = "六";
        }
        return s;
    }

}
